package com.yq.cp.utils.wx;




import java.io.InputStream;

public class MyWXPayConfig implements WXPayConfig {
    public static  String APP_ID = "wx7385eb1a1c4ba2b4";
    public static  String MCH_ID = "1605814442";
    public static  String KEY = "bIxaet9XJI0AgVh9YugfmSl4dUPmuQMn";
    @Override
    public String getAppID() {
        return APP_ID;
    }

    @Override
    public String getMchID() {
        return MCH_ID;
    }

    @Override
    public String getKey() {
        return KEY;
    }

    @Override
    public void setAppID(String appId) {
        APP_ID=appId;
    }

    @Override
    public void setMchID(String macId) {
        MCH_ID=macId;
    }

    @Override
    public void setKey(String key) {
        KEY=key;
    }


    @Override
    public InputStream getCertStream() {
        return getClass().getClassLoader().getResourceAsStream("apiclient_cert.p12");
    }

    @Override
    public IWXPayDomain getWXPayDomain() {
        return new MyIWXPayDomain();
    }

    private static class MyIWXPayDomain implements IWXPayDomain {
        @Override
        public void report(String domain, long elapsedTimeMillis, Exception ex) {
        }

        @Override
        public DomainInfo getDomain(WXPayConfig config) {
            return new DomainInfo(WXPayConstants.DOMAIN_API, true);
        }
    }
}